package com.chigga.admin.service.impl;

import com.chigga.admin.domain.entity.AdminDO;
import com.chigga.admin.service.AdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
@Slf4j
public class AdminServiceImpl implements AdminService {
    /**
     * 测试 TimeAspect 计时切面触发
     */
    @Override
    public List<AdminDO> testTimeAspect() {
        log.info("testTimeAspect 方法开始");
        ArrayList<AdminDO> list = new ArrayList<>();
        for (int i = 0; i < 1000000; i++) {
            AdminDO adminDO = new AdminDO();
            adminDO.setId(i + "");
            adminDO.setName("DefChigga" + i);
            list.add(adminDO);
        }
        log.info("testTimeAspect 方法结束");
        return list.subList(0, 7);
    }
}
